#[cfg(test)]
mod tests {
    use anyhow::Result;

    use crate::{
        db::{db_user, db_user_role},
        test::test_common::tests::test_common_init,
    };

    #[tokio::test]
    async fn test_get_user_roles() -> Result<()> {
        test_common_init().await?;
        let user = db_user::find_by_login_name("admin").await?.unwrap();
        println!("user : {:?}", user);
        let roles = db_user_role::find_by_user_id(user.id).await?;
        println!("roles : {:?}", roles);
        assert_eq!(roles.len(), 1);
        assert_eq!(roles[0], "admin");
        Ok(())
    }
}
